<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 100px;
            height: 100px;
        }
        .box1{
            background-color: red;
        }
        .box2{
            background-color: blue;
        }
        .box3{
            background-color: yellow;
        }
    </style>
</head>
<body>
    <!-- <div class="mydiv">我是div</div>
     -->
     <!-- <div>张三</div>
     <button>点击我</button> -->
     <div class="box1"></div>
     <div class="box2"></div>
     <div class="box3"></div>
    <script>

        // 可以修改元素里的超文本（html）
        // var mydivEle = document.getElementsByClassName("mydiv")[0];

        // mydivEle.innerHTML = "修改了";
        var flag = true;
        document.querySelector("button").onclick = function(){
            flag = !flag;
            console.log(flag);
        }

    </script>
</body>
</html>